<template>
  <VChart
    ref="vueEcharts1"
    v-bind="$props"
    v-on="$listeners"
    autoresize
    style="width: 100%; height: 100%"
  />
</template>
<!--
author： 叶明龙
email： 18591978263@126.com
基于echarts vue-echarts 二次开发的VueEchart组件
-->
<script>
// npm install echarts vue-echarts
// npm i -D @vue/composition-api
import * as echarts from "echarts";
import VChart from "vue-echarts";
export default {
  name: "VueEchart",
  components: {
    VChart
  },
  props: {
    option: {
      type: Object,
      default: () => {
        return {
          xAxis: {
            type: "category",
            data: []
          },
          yAxis: {
            type: "value"
          },
          series: []
        };
      },
      required: true
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  beforeDestroy() {
    this.$refs.vueEcharts1.dispose();
  },
  methods: {
    getWidth: function() {
      this.$refs.vueEcharts1.getWidth(...arguments);
    },
    getHeight: function() {
      this.$refs.vueEcharts1.getHeight(...arguments);
    },
    getDom: function() {
      this.$refs.vueEcharts1.getDom(...arguments);
    },
    getOption: function() {
      this.$refs.vueEcharts1.getOption(...arguments);
    },
    resize: function() {
      this.$refs.vueEcharts1.resize(...arguments);
    },
    dispatchAction: function() {
      this.$refs.vueEcharts1.dispatchAction(...arguments);
    },
    convertToPixel: function() {
      this.$refs.vueEcharts1.convertToPixel(...arguments);
    },
    convertFromPixel: function() {
      this.$refs.vueEcharts1.convertFromPixel(...arguments);
    },
    containPixel: function() {
      this.$refs.vueEcharts1.containPixel(...arguments);
    },
    getDataURL: function() {
      this.$refs.vueEcharts1.getDataURL(...arguments);
    },
    getConnectedDataURL: function() {
      this.$refs.vueEcharts1.getConnectedDataURL(...arguments);
    },
    appendData: function() {
      this.$refs.vueEcharts1.appendData(...arguments);
    },
    clear: function() {
      this.$refs.vueEcharts1.clear(...arguments);
    },
    isDisposed: function() {
      this.$refs.vueEcharts1.isDisposed(...arguments);
    },
    dispose: function() {
      this.$refs.vueEcharts1.dispose(...arguments);
    },
    setOption: function() {
      this.$refs.vueEcharts1.setOption(...arguments);
    }
  }
};
export { echarts };
</script>
<style lang="scss" scoped></style>
